package io.hilo.example.account.web;

import org.jretty.apibase.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import io.hilo.example.account.service.DemoPlainService;

/**
 * Controller Demo
 * 
 * @author xxxx
 * @since 2023-10-12
 */
@RestController
@RequestMapping("/app")
public class DemoPlainController {
    @Autowired
    private DemoPlainService service;
    
    /**
     * hello
     */
    @GetMapping("/hello")
    public Result<?> hello() {
        return Result.success("Hilo framework running!");
    }
    
    /**
     * Dubbo service demo
     */
    @GetMapping("/add")
    public Result<?> add(@RequestParam Integer a, @RequestParam Integer b) {
        
        return Result.success(service.add(a, b));
    }

}
